

axios.interceptors.request.use(
    config => {
        if (localStorage.getItem('token')) {
            config.headers.token = localStorage.getItem('token');
        }
        return config;
    }, error => {

        return Promise.reject(error);

    });

axios.interceptors.response.use((response) => {
    return response;
}, function (error) {
    if (401 === error.response.status) {
        window.location = '/font/page/login.html';
    } else {
        return Promise.reject(error);
    }
});